_P_a_x reads and writes archive files which conform to the
AAAArrrrcccchhhhiiiivvvveeee////IIIInnnntttteeeerrrrcccchhhhaaaannnnggggeeee FFFFiiiilllleeee FFFFoooorrrrmmmmaaaatttt specified in _I_E_E_E _S_t_d. _1_0_0_3._1-_1_9_8_8. _P_a_x
can also read, but not write, a number of other file formats in addition
to those specified in the AAAArrrrcccchhhhiiiivvvveeee////IIIInnnntttteeeerrrrcccchhhhaaaannnnggggeeee FFFFiiiilllleeee FFFFoooorrrrmmmmaaaatttt description.
Support for these traditional file formats, such as V7 _t_a_r and System V
binary _c_p_i_o format archives, is provided for backward compatibility and
to maximize portability.
_P_a_x will also support traditional _c_p_i_o and System V _t_a_r interfaces if
invoked with the name "cpio" or "tar" respectively. See the _c_p_i_o(_1) or
_t_a_r(_1) manual pages for more details.
Combinations of the ----rrrr and ----wwww command line arguments specify whether _p_a_x
will read, write or list the contents of the specified archive, or move
the specified files to another directory.
The command line arguments are:
----wwww writes the contents of the file operands to the standard output in
an archive format. If no _f_i_l_e operands are specified, a list of
files to copy, one per line, will be read from the standard input. A
file of type directory will include all of the files in the file
hierarchy rooted at the file.
----rrrr _P_a_x extracts the members of the archive file read from the standard
input, with pathnames matching the specified patterns. If an
extracted file is of type directory, the file hierarchy rooted at
that file will be extracted as well. The extracted files is created
relative to the current file hierarchy. By default, the owner and
group of selected files will be that of the invoking process, and
the permissions and modification times will be the sames as those in
the archive.
PPPPaaaaggggeeee 1111
PPPPAAAAXXXX((((1111)))) PPPPAAAAXXXX((((1111))))
The supported archive formats are automatically detected on input.
The default output format is _u_s_t_a_r, but may be overridden by the ----xxxx
_f_o_r_m_a_t option described below.
----rrrrwwww _P_a_x copies the file operands to the destination directory. If no
_f_i_l_e operands are specified, a list of files to copy, one per line,
will be read from the standard input. A file of type directory will
include all of the files in the file hierarchy rooted at the file.
The directory named by the _d_i_r_e_c_t_o_r_y operand must exist and have the
proper permissions before the copy can occur.
If neither the ----rrrr or ----wwww options are given, then _p_a_x will list the
contents of the specified archive. In this mode, _p_a_x lists normal files
one per line, hard link pathnames as
_p_a_t_h_n_a_m_e == _l_i_n_k_n_a_m_e
and symbolic link pathnames (if supported by the implementation) as
_p_a_t_h_n_a_m_e -> _l_i_n_k_n_a_m_e
where _p_a_t_h_n_a_m_e is the name of the file being extracted, and _l_i_n_k_n_a_m_e is
the name of a file which appeared earlier in the archive.
If the ----vvvv option is specified, then _p_a_x list normal pathnames in the same
format used by the _l_s utility with the ----llll option. Hard links are shown
as
<_l_s -_l _l_i_s_t_i_n_g> == _l_i_n_k_n_a_m_e
and symbolic links (if supported) are shown as
<_l_s -_l _l_i_s_t_i_n_g> -> _l_i_n_k_n_a_m_e
_P_a_x is capable of reading and writing archives which span multiple
physical volumes. Upon detecting an end of medium on an archive which is
not yet completed, _p_a_x will prompt the user for the next volume of the
archive and will allow the user to specify the location of the next
volume.
OOOOppppttttiiiioooonnnnssss
The following options are available:
----aaaa Append files to the end of archive.
----bbbb _b_l_o_c_k_s_i_z_e
Block the output at _b_l_o_c_k_s_i_z_e bytes per write to the archive
file. A kkkk suffix multiplies _b_l_o_c_k_i_n_g by 1024, a bbbb suffix
multiplies _b_l_o_c_k_i_n_g by 512 and a mmmm suffix multiplies _b_l_o_c_k_i_n_g
by 1048576 (1 megabyte). For machines with 16-bit int's
(VAXen, XENIX-286, etc.), the maximum buffer size is 32k-1. If
PPPPaaaaggggeeee 2222
PPPPAAAAXXXX((((1111)))) PPPPAAAAXXXX((((1111))))
not specified, _b_l_o_c_k_s_i_z_e is automatically determined on input
and is ignored for ----rrrrwwww....
----cccc Match all file or archive members except those specified by the
_p_a_t_t_e_r_n or _f_i_l_e operands.
----dddd Cause files of type directory being copied or archived or
archive members of type directory being extracted to match only
the file or archive member itself and not the file hierarchy
rooted at the file.
----ffff _a_r_c_h_i_v_e
The _a_r_c_h_i_v_e option specifies the pathname of the input or
output archive, overriding the default of standard input for ----rrrr
or standard output for ----wwww.
----iiii Interactively rename files. Substitutions specified by ----ssss
options (described below) are performed before requesting the
new file name from the user. A file is skipped if an empty
line is entered and _p_a_x exits with an exit status of 0 if EEEEOOOOFFFF
is encountered.
----kkkk Prevent the overwriting of existing files.
----llll Files are linked rather than copied when possible.
----nnnn When ----rrrr is specified, but ----wwww is not, the _p_a_t_t_e_r_n arguments are
treated as ordinary file names. Only the first occurrence of
each of these files in the input archive is read. The ppppaaaaxxxx
utility exits with a zero exit status after all files in the
list have been read. If one or more files in the list is not
found, ppppaaaaxxxx writes a diagnostic to standard error for each of
the files and exits with a non-zero exit status. the file
names are compared before either the ----iiii, or ----ssss, options are
applied.
----oooo _o_p_t_i_o_n_s
Provide information to the implementation to modify the
algorithm for extracting or writing files that is specific to
the file format specified by ----xxxx....
----pppp _s_t_r_i_n_g Specify one or more file characteristic options (privileges).
The _s_t_r_i_n_g option-argument must be a string specifying file
characteristics to be retained or discarded on extraction. The
string consists of the specification characters a, e, m, o and
p. Multiple characteristics can be concatenated within the same
string and multiple -p options can be specified. The meaning of
the specification characters are as follows:
aaaa Do not preserve file access times.
eeee Preserve the user ID, group ID, file mode, access time, and
modification time.
mmmm Do not preserve file modification times.
PPPPaaaaggggeeee 3333
PPPPAAAAXXXX((((1111)))) PPPPAAAAXXXX((((1111))))
oooo Preserve the user ID and group ID.
pppp Preserve the file mode bits.
In the preceding list, "preserve" indicates that an attribute
stored in the archive will be given to the extracted file,
subject to the permissions of the invoking process; otherwise,
the attribute will be determined as part of the normal file
creation action.
If neither the e nor the o specification character is
specified, or the user ID and group ID are not preserved for
any reason, pax will not set the S_ISUID and S_ISGID bits of
the file mode.
If the preservation of any of these items fails for any reason,
pax will write a diagnostic message to standard error. Failure
to preserve these items will affect the final exit status, but
will not cause the extracted file to be deleted.
If file-characteristic letters in any of the string option-
arguments are duplicated or conflict with each other, the ones
given last will take precedence. For example, if -p eme is
specified, file modification times will be preserved.
----ssss _r_e_p_l_s_t_r
File names are modified according to the substitution
expression using the syntax of _e_d(_1) as shown:
-s /_o_l_d/_n_e_w/[[[[gp]]]]
Any non null character may be used as a delimiter (a / is used
here as an example). Multiple ----ssss expressions may be specified;
the expressions are applied in the order specified terminating
with the first successful substitution. The optional trailing
pppp causes successful mappings to be listed on standard error.
The optional trailing gggg causes the _o_l_d expression to be
replaced each time it occurs in the source string. Files that
substitute to an empty string are ignored both on input and
output.
----tttt Cause the access times of the archived files to be the same as
they were before being read by pax. ----rrrr and standard output for
----wwww.
----uuuu Copy each file only if it is newer than a pre-existing file
with the same name. This implies ----aaaa.
----vvvv List file names as they are encountered. Produces a verbose
table of contents listing on the standard output when both ----rrrr
and ----wwww are omitted, otherwise the file names are printed to
standard error as they are encountered in the archive.
PPPPaaaaggggeeee 4444
PPPPAAAAXXXX((((1111)))) PPPPAAAAXXXX((((1111))))
----xxxx _f_o_r_m_a_t Specifies the output archive _f_o_r_m_a_t. The input format, which
must be one of the following, is automatically determined when
the ----rrrr option is used. The supported formats are:
_c_p_i_o The extended _C_P_I_O interchange format specified in
_u_s_t_a_r The extended _T_A_R interchange format specified in
EEEExxxxtttteeeennnnddddeeeedddd TTTTAAAARRRR FFFFoooorrrrmmmmaaaatttt iiiinnnn _I_E_E_E _S_t_d. _1_0_0_3._1-_1_9_8_8. This is
the default archive format.
----BBBB _b_y_t_e_s Non-standard option on number of bytes written on a single
archive volume.
----DDDD On extraction check file inode change time before the
modification of the file name. Non standard option.
----EEEE _l_i_m_i_t Non-standard limit on read faults 0 indicates stop after first
error, values indicate a limit, "NONE" try forever
----GGGG _g_r_o_u_p Non-standard option for selecting files within an archive by
group (gid or name)
----HHHH Follow command line symlinks only. Non standard option.
----LLLL Follow symlinks. Non standard option.
----PPPP Do NOT follow symlinks (default).
----TTTT _f_r_o_m__d_a_t_e,_t_o__d_a_t_e
Non-standard option for selecting files within an archive by
modification time range (lower,upper)
----UUUU _u_s_e_r Non-standard option for selecting files within an archive by
user (uid or name).
----XXXX Do not pass over mount points in the file system. Non standard
option.
----YYYY On extraction check file inode change time after the
modification of the file name. Non standard option.
----ZZZZ On extraction check modification time after the modification of
the file name. Non standard option.
When writing to an archive, the standard input is used as a list of
pathnames if no _p_a_t_h_n_a_m_e operands are specified. The format is one
pathname per line. Otherwise, the standard input is the archive file,
which is formatted according to one of the specifications in
AAAArrrrcccchhhhiiiivvvveeee////IIIInnnntttteeeerrrrcccchhhhaaaannnnggggeeee FFFFiiiilllleeee ffffoooorrrrmmmmaaaatttt in _I_E_E_E _S_t_d. _1_0_0_3._1-_1_9_8_8, or some other
implementation-defined format.
PPPPaaaaggggeeee 5555
PPPPAAAAXXXX((((1111)))) PPPPAAAAXXXX((((1111))))
The user ID and group ID of the process, together with the appropriate
privileges, affect the ability of _p_a_x to restore ownership and
permissions attributes of the archived files. (See _f_o_r_m_a_t-_r_e_a_d_i_n_g
_u_t_i_l_i_t_y in AAAArrrrcccchhhhiiiivvvveeee////IIIInnnntttteeeerrrrcccchhhhaaaannnnggggeeee FFFFiiiilllleeee FFFFoooorrrrmmmmaaaatttt in _I_E_E_E _S_t_d. _1_0_0_3._1-_1_9_8_8.)
OOOOppppeeeerrrraaaannnnddddssss
The following operands are available:
_d_i_r_e_c_t_o_r_y The destination directory pathname for copies when both the ----rrrr
and ----wwww options are specified. The directory must exist and be
writable before the copy or and error results.
_f_i_l_e A pathname of a file to be copied or archived. When a directory
is named, all of its files and (recursively) subdirectories are
copied as well.
_p_a_t_t_e_r_n A _p_a_t_t_e_r_n is given in the standard shell pattern matching
notation. The default if no _p_a_t_t_e_r_n is specified is ****, which
selects all files.
EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
The following command
pax -w -f /dev/rmt0 .
copies the contents of the current directory to tape drive 0.
The commands
mkdir _n_e_w_d_i_r
cd _o_l_d_d_i_r
pax -rw . _n_e_w_d_i_r
copies the contents of _o_l_d_d_i_r to _n_e_w_d_i_r .
The command
pax -r -s ',//*usr//*,,' -f pax.out
reads the archive ppppaaaaxxxx....oooouuuutttt with all files rooted in "/usr" in the archive
extracted relative to the current directory.
FFFFIIIILLLLEEEESSSS
/dev/tty used to prompt the user for information when the ----iiii option are
specified.
SSSSEEEEEEEE AAAALLLLSSSSOOOO
cpio(1), find(1), tar(1), cpio(5), tar(5)
PPPPaaaaggggeeee 6666
PPPPAAAAXXXX((((1111)))) PPPPAAAAXXXX((((1111))))
DIAGNOSTICS
_P_a_x will terminate immediately, without processing any additional files
on the command line or in the archive.
EEEEXXXXIIIITTTT CCCCOOOODDDDEEEESSSS
_P_a_x will exit with one of the following values:
0 All files in the archive were processed successfully.
>0 _P_a_x aborted due to errors encountered during operation.
BBBBUUUUGGGGSSSS
Special permissions may be required to copy or extract special files.
Device, user ID, and group ID numbers larger than 65535 cause additional
header records to be output. These records are ignored by some
historical version of _c_p_i_o(_1) and _t_a_r(_1).
The archive formats described in AAAArrrrcccchhhhiiiivvvveeee////IIIInnnntttteeeerrrrcccchhhhaaaannnnggggeeee FFFFiiiilllleeee FFFFoooorrrrmmmmaaaatttt have
certain restrictions that have been carried over from historical usage.
For example, there are restrictions on the length of pathnames stored in
the archive.
When getting an "ls -l" style listing on _t_a_r format archives, link counts
are listed as zero since the _u_s_t_a_r archive format does not keep link
count information.
On 16 bit architectures, the largest buffer size is 32k-1. This is due,
in part, to using integers in the buffer allocation schemes, however, on
many of these machines, it is not possible to allocate blocks of memory
larger than 32k.
CCCCOOOOPPPPYYYYRRRRIIIIGGGGHHHHTTTT
Copyright (c) 1989 Mark H. Colburn.
All rights reserved.
Redistribution and use in source and binary forms are permitted provided
that the above copyright notice is duplicated in all such forms and that
any documentation, advertising materials, and other materials related to
such distribution and use acknowledge that the software was developed by
Mark H. Colburn and sponsored by The USENIX Association.
THE SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
AAAAUUUUTTTTHHHHOOOORRRR
Mark H. Colburn
Minnetech Consulting, Inc.
117 Mackubin Street, Suite 1
St. Paul, MN 55102
mark@jhereg.MN.ORG
PPPPaaaaggggeeee 7777
PPPPAAAAXXXX((((1111)))) PPPPAAAAXXXX((((1111))))
Sponsored by TTTThhhheeee UUUUSSSSEEEENNNNIIIIXXXX AAAAssssssssoooocccciiiiaaaattttiiiioooonnnn for public distribution.